package com.neuedu.learn;

public class Demo7 {

    /**
     * 运算  三目运算
     * @param arg
     */
    public static void main(String arg[]){

//        表达式 ？ xxx1 :xxx2

//        int age =  61;
//
//        String result = age >= 60 ? "允许退休" : "不允许退休";

        int age = 60;
        char gender = '男';
//        boolean result = (age >= 60   && gender == '男' )   ||  (age >= 55   && gender == '女');

        String result = age >= 60  ?  "允许退休" :   (       (age >= 55   && gender == '女') ? "退休":"不允许退休"            );

        System.out.println("result = " + result);


//        instance of
        Person person = new Person();

        System.out.println("(\"abc\" instanceof String) = " + ("abc" instanceof String));
        System.out.println("(person instanceof  Person) = " + (person instanceof Person));
        System.out.println("(person instanceof  Object) = " + (person instanceof Object));



        //运算符优先级

        int resultCal = (10 + 20) * 3 / 5;





    }



   public static class Person {

   }



}
